﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace demo_ver2
{
    public partial class WordControl : UserControl
    {
        string filename = "";
        int hWnd = 0;
       // bool wasActived = false;
        public WordControl(string _filename,int index)
        {
            InitializeComponent(index);
            this.filename = _filename;
        }

        public void open()
        {
            this.hWnd = this.winWordControl1.LoadDocument(filename);
        }

        public void reactive()
        {
           // if (!wasActived)
            {
                this.winWordControl1.ReActiveWindow(this.hWnd);
               // wasActived = true;
            }
        }
    }
}
